package jjn.round1;

/**
 * @author Jjn
 * @since 2022-09-01 21:48
 */
public class LeetCode1475_FinalPricesWithASpecialDiscountInAShop {
    public int[] finalPrices(int[] prices) {
        for (int i = 0; i < prices.length; i++) {
            for (int j = i + 1; j < prices.length; j++) {
                if (prices[i] >= prices[j]) {
                    prices[i] = prices[i] - prices[j];
                    break;
                }
            }
        }
        return prices;
    }
}
